/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.jeesite.modules.qywx.service;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.jeesite.common.entity.Page;
import com.jeesite.common.service.CrudService;
import com.jeesite.modules.qywx.entity.QiyePush;
import com.jeesite.modules.qywx.dao.QiyePushDao;
import com.jeesite.modules.file.utils.FileUploadUtils;

/**
 * 企业微信公众号维护管理Service
 * @author SunXiaobing
 * @version 2019-08-13
 */
@Service
@Transactional(readOnly=true)
public class QiyePushService extends CrudService<QiyePushDao, QiyePush> {
	
	/**
	 * 获取单条数据
	 * @param qiyePush
	 * @return
	 */
	@Override
	public QiyePush get(QiyePush qiyePush) {
		return super.get(qiyePush);
	}
	
	/**
	 * 查询分页数据
	 * @param qiyePush 查询条件
	 * @param qiyePush.page 分页对象
	 * @return
	 */
	@Override
	public Page<QiyePush> findPage(QiyePush qiyePush) {
		return super.findPage(qiyePush);
	}
	
	/**
	 * 保存数据（插入或更新）
	 * @param qiyePush
	 */
	@Override
	@Transactional(readOnly=false)
	public void save(QiyePush qiyePush) {
		super.save(qiyePush);
		// 保存上传图片
		FileUploadUtils.saveFileUpload(qiyePush.getId(), "qiyePush_image");
		// 保存上传附件
		FileUploadUtils.saveFileUpload(qiyePush.getId(), "qiyePush_file");
	}
	
	/**
	 * 更新状态
	 * @param qiyePush
	 */
	@Override
	@Transactional(readOnly=false)
	public void updateStatus(QiyePush qiyePush) {
		super.updateStatus(qiyePush);
	}
	
	/**
	 * 删除数据
	 * @param qiyePush
	 */
	@Override
	@Transactional(readOnly=false)
	public void delete(QiyePush qiyePush) {
		super.delete(qiyePush);
	}
	
}